package me.j360.springboot.simple.bean.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import javax.validation.constraints.NotNull;

/**
 * Created with springbootweb -> me.j360.springboot.simple.bean.config.
 * User: min_xu
 * Date: 2015/7/29
 * Time: 13:50
 * 说明：另一种配置方法
 */
@Component
@ConfigurationProperties(prefix="connection")
public class ConfigurationPropertiesConfig {

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getRemoteAddress() {
        return remoteAddress;
    }

    public void setRemoteAddress(String remoteAddress) {
        this.remoteAddress = remoteAddress;
    }

    //
    @NotNull
    private String username;
    private String remoteAddress;
}
